package com.ivi.car.module.city.view.util;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * 重新测量GridView改变其默认模式
 */
public class HotGridView extends GridView {
    private final int b = 2; //向右补号2

    public HotGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public HotGridView(Context context) {
        super(context);
    }

    public HotGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> b,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
